// 已汇总的查看表
<template>
    <div class="e-table">
        <el-table
              :data="summaryData"
                                border
                                style="width: 100%"
        >
            <el-table-column
                prop="billNo"
                label="汇总编号"
                min-width="200"
                align="left"
            >
            </el-table-column>
            <el-table-column
                prop="orgName"
                label="汇总机构"
                min-width="200"
                align="left"
            >
            </el-table-column>
            <el-table-column
                prop="approvalQuantity"
                label="核准数量"
                width="200"
            >
            </el-table-column>
            <el-table-column
                prop="approvalPrice"
                label="核准单价"
                width="200"
            >
            </el-table-column>
            <el-table-column
                prop="approvalAmount"
                label="核准金额"
                width="200"
            >
            </el-table-column>
            <el-table-column
                prop="purchasingUnitName"
                label="集中采购单位"
                width="200"
            >
            </el-table-column>
            <el-table-column
                prop="procurementMethod"
                label="采购方式"
                width="200"
            >
            <template slot-scope="{row}">
                                   <span>{{procurementMethodComputed(row)}}</span>
                                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
import { mapState } from 'vuex'
import planRequest from '@/api/turnover/plan.js'

export default {
    created () {
        this.dtlId = this.$route.query.dtlId

        this.getList()
    },
    computed: {
        ...mapState({
            procurementMethodArr: state =>state.turnover.turnoverData.procurementMethod //采购方式
        }),

        procurementMethodComputed () {

            return (row = {})=> {
                const obj = this.procurementMethodArr.find(v => v.value === row.procurementMethod)
                return obj ? obj.label : ''
            }
        }
    },
    data () {
        return {
            summaryData: []

        }
    },
    methods: {
        getList () {
            planRequest.turnoverAnnualDemandPlanGetSummarySituation(this.dtlId).then(res=>{
                this.summaryData = res
            })
        }
    }
}
</script>

<style lang="scss" scoped></style>
